<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>v-on语法糖</title>
</head>
<body>

<div id="app">
  <!--v-on全写-->
  <button v-on:click="log()">打印</button>
  <!--v-on语法糖（简写）-->
  <button @click="log()">打印</button>
</div>

<script src="../js/vue.js"></script>
<script>
  let app = new Vue({
    el: '#app',
    data: {
      message: 'Hello,Vue.js!',
    },
    methods: {
      log() {
        console.log(this.message);
      }
    },
  });
</script>

</body>
</html>